#ifndef _LOGIN_SESSION_H
#define _LOGIN_SESSION_H
#include "xTCPTask.h"
#include <map>
using namespace xNet;
class LoginSession : public xTCPTask
{
    public:
        LoginSession(xSocket* sock);
    public:
        void Online();
        void Offline();
    public:
        virtual bool Update(uint32 diff) override;
        virtual bool VaildOpCode(uint16 opcode) override;
        virtual bool HandleDataPacket(DataPacket* pack) override;
        virtual void AddSession(xTCPTask* task) override;
    private:
        typedef void (LoginSession::*OpcodeHandlerFunc)(DataPacket& packet);
        typedef std::map<uint16,OpcodeHandlerFunc> OpcodeHandlerMap;
};
#endif